ops_set_texture (builder, region.texture_id);
op = ops_begin (builder, OP_CHANGE_REPEAT);
- op->child_bounds[0] = 0; /* Both currently unused */
- op->child_bounds[1] = 0;
+ op->child_bounds[0] = (node->bounds.origin.x - child_bounds->origin.x) / child_bounds->size.width;
+ op->child_bounds[1] = (node->bounds.origin.y - child_bounds->origin.y) / child_bounds->size.height;
op->child_bounds[2] = node->bounds.size.width / child_bounds->size.width;
op->child_bounds[3] = node->bounds.size.height / child_bounds->size.height;
float mapped_x = (vUv.x - u_texture_rect.x) / tw;
float mapped_y = (vUv.y - u_texture_rect.y) / th;
- float wrapped_x = wrap(mapped_x * u_child_bounds.z, 1.0);
- float wrapped_y = wrap(mapped_y * u_child_bounds.w, 1.0);
+ float wrapped_x = u_child_bounds.x + wrap(mapped_x * u_child_bounds.z, 1.0);
+ float wrapped_y = u_child_bounds.y + wrap(mapped_y * u_child_bounds.w, 1.0);
vec2 tp;
tp.x = u_texture_rect.x + (wrapped_x * tw);